package com.email.box.common.enums;

import java.util.Arrays;

/**
 * er图查询类型
 *
 * @author lixuan
 */
public enum ErThemeEnum {
    //查询类型
    ALL(0, "全部"),
    ENTITY(1, "实体类"),
    SUBJECT_DOMAIN(2, "主题域"),
    RELATION(3, "关系");

    private int code;
    private String message;

    ErThemeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public static ErThemeEnum getErThemeEnum(int code) {
        return Arrays.stream(ErThemeEnum.values()).filter(x -> x.code == code).findFirst().orElse(null);
    }
}
